declare const array: string[];

for (const i in array) {
  console.log(array[i]);
}

for (const i in array) {
  console.log(i, array[i]);
}

//github
for (const x in [3, 4, 5]) {
  console.log(x);
}

const z = [3, 4, 5];
for (const x in z) {
  console.log(x);
}

const fn = (arr: number[]) => {
  for (const x in arr) {
    console.log(x);
  }
};

const fn = (arr: number[] | string[]) => {
  for (const x in arr) {
    console.log(x);
  }
};

const fn = <T extends any[]>(arr: T) => {
  for (const x in arr) {
    console.log(x);
  }
};